<?php

use Illuminate\Database\Seeder;
use App\Models\SettingHint;
class SettingHintTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
//        factory(\App\Models\SettingHint::class,7)->create([]);
        $typeList = SettingHint::hintType();
        $channel_list = \App\Models\SettingChannel::$CHANNEL_LIST;
        $insertData = array();
        $insertDataTrue = array();
        foreach ($typeList as $k => $v){
            $content = isset(SettingHint::$HINT_LIST[$k]) ? SettingHint::$HINT_LIST[$k] : '';
            if(!$v['is_channel_code']){
                $data = array();
                $data['type'] = $k;
                $data['content'] = $content;
                $insertData[] = $data;
            }else{
                foreach ($channel_list as $key => $val){
                    $data = array();
                    $data['type'] = $k;
                    $data['channel_code'] = $key;
                    $data['content'] = $content;
                    $insertDataTrue[] = $data;
                }

            }
        }
        DB::table('setting_hints') -> insert($insertData);
        DB::table('setting_hints') -> insert($insertDataTrue);
    }
}
